#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
//此示例用图形化方式进行创建
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->comboBox->addItem("汉堡1");
    ui->comboBox->addItem("汉堡2");
    ui->comboBox->addItem("汉堡3");

    ui->comboBox2->addItem("小食1");
    ui->comboBox2->addItem("小食2");
    ui->comboBox2->addItem("小食3");

    ui->comboBox3->addItem("饮料1");
    ui->comboBox3->addItem("饮料2");
    ui->comboBox3->addItem("饮料3");

    box=new QGroupBox(this);
    box->setGeometry(500,50,500,300);

    box->setTitle("标题");
    box->setAlignment(Qt::AlignCenter);//设置居中对齐
    box->setFlat(true);//设置为扁平模式
    box->setCheckable(true);//设置为可选择模式
    box->setChecked(false);//不选择此分组框

}

Widget::~Widget()
{
    delete ui;
}

